<extend name="./App/Common/View/default/Base/common.html" />
<block name="style">
<style type="text/css">
    .picture_list{ overflow:hidden; zoom:1}
    .picture_list li{ float:left; margin:10px;}
    .picture_item{ border:1px solid #ddd;}
    .picture_item .main_img{padding:5px; width:200px; height:160px; overflow:hidden;}
    .picture_item .main_img img{ height: auto;width: 100%}
    .picture_action{ border-top:1px solid #ddd; overflow:hidden; zoom:1;}
    .picture_action a{ width:50%; float:left; height:40px; line-height:40px; text-align:center; color:#888; background:#eee}
    .picture_action a:hover{ background:#ddd;}
    ul.img-list > img { width: 100px; height: 100px; float: left; margin: 5px }
</style>
</block>
<block name="main_content">
<include file="./App/Common/View/default/Public/crumb.html" />
<div class="mod">
    <div class="mod-head">
        <h3>
            <include file="./App/Common/View/default/Public/nav.html" />
        </h3>
    </div>
    <div class="mod-body tab-content">
        <div class="tab-pane active" id="list">
            <if condition="$tip">
                <div class="alert alert-info tip" role="alert">{$tip}</div>
            </if>
            <div class="mod-table-head">
                <volist name="btn" id="vo">
                    <a class="{$vo.class}" href="{$vo.url}" {$vo.attr}>{$vo.title}</a>&nbsp;
                </volist>
            </div>
            <form action="" method="post">
	            <input type="hidden" id="action" name="action" value="del">
	            <div class="table-responsive">
	                <ul class="picture_list">   
	                	<volist name="lists" id="vo">     
	                   <li>
	                    	<div class="picture_item">
	                            <div class="main_img">
	                                <a href="{$vo.image}" target="_blank"><img src="{$vo.image}"></a>
	                            </div>
	                            <div class="picture_action">
	                                <a href="{:U('edit',array('id'=>$vo['id']))}">编辑</a>
	                                <a href="{:U('delete',array('id'=>$vo['id']))}" class="del_material">删除</a>	
	                            </div>
	                      
	                        </div>
	                    </li>
	                    </volist>     	
	                </ul>
	            </div>
            </form>
            <div class="mod-table-foot">
                {$pagination}
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function() {
        $('.del_material').on('click', function() {
            if (confirm('删除此素材，可能会导致引用了该素材的内容不可用，是否确认要删除？')) {
                window.location.href = $(this).attr('href');
                return false;
            } else {
                return false;
            }
        });
    });
</script>
</block>